package cn.qingyun.gis.modules.enterprise.controller;


import cn.qingyun.gis.common.Result;
import cn.qingyun.gis.modules.enterprise.request.BuildingRequest;
import cn.qingyun.gis.modules.enterprise.request.EnterpriseRequest;
import cn.qingyun.gis.modules.enterprise.request.OverviewRequest;
import cn.qingyun.gis.modules.enterprise.service.IEnterpriseService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 企业表 前端控制器
 * </p>
 *
 * @author skb
 * @since 2024-03-29
 */
@RestController
@RequestMapping("/enterprise")
public class EnterpriseController {

    @Autowired
    private IEnterpriseService enterpriseService;

    @ApiOperation("获取企业数据概览")
    @PostMapping("/overview")
    public Result<?> getOverviewData(@RequestBody OverviewRequest overviewRequest) {
        return Result.okData(enterpriseService.getOverviewData(overviewRequest));
    }

    @ApiOperation("获取企业列表")
    @PostMapping("/list")
    public Result<?> getEnterpriseList(@RequestBody EnterpriseRequest enterpriseRequest) {
        return Result.okData(enterpriseService.getEnterpriseList(enterpriseRequest));
    }

    @ApiOperation("获取企业详情")
    @GetMapping("/detail")
    public Result<?> getEnterpriseDetails(@RequestParam(name = "id") String id) {
        return Result.okData(enterpriseService.getEnterpriseDetails(id));
    }



}
